<template>
  <div class="anchor">
    <div class="title">歌手</div>
    <div class="more" ><a href="/singermore">更多</a></div>
    <div class="anchor-item">
      <div class="anchor-left">
        <img :src="anchors.picUrl" alt="" />
        <p>{{anchors.name}}</p>
      </div>
      <div class="anchor-right">
        <div class="right-img" v-for="item of anchor" :key="item.id" @click="handleDetail(item.id)">
          <img :src="item.picUrl" alt="" />
          <p>{{item.name}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      anchors: [],
      anchor: [],
    };
  },
  mounted() {
    this.$http.get("/artist/list?type=-1").then((res) => {
      this.anchor = res.data.artists.slice(2, 6);
      this.anchors = res.data.artists[0];
    });
  },
  methods:{
    handleDetail(val){
      this.$router.push(`/singerdetail?id=${val}`)
    }
  }
};
</script>

<style scoped>
.anchor {
  width: 1200px;
  margin: 0 auto;
}
.title {
  width: 220px;
  text-align: center;
  margin: 0 auto;
  padding: 10px 0;
  border-radius: 18px;
  background-color: #abc4ff;
}
.more {
  text-align: right;
  margin-right: 30px;
}
.anchor-item {
  padding: 0 35px;
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}
.anchor-left {
  width: 400px;
  height: 450px;
  /* background-color: pink; */
}
.anchor-left p {
    margin-top: 20px;
}
.anchor-left img {
  width: 400px;
  height: 400px;
  border-radius: 20px;
}
.anchor-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 700px;
  height: 400px;
  /* background-color: purple; */
}
.right-img {
  margin-top: 10px;
  border-radius: 20px;
  width: 340px;
  height: 180px;
  background-color: yellow;
}
.right-img img {
  border-radius: 20px;
  width: 340px;
  height: 180px;
}
</style>